package org.jvm.weechat;

import java.util.HashMap;
import java.util.Map;

public class User {
    public static void main(String[] args) {
        boolean state =login("zhangsan","123456");
    }

    public static boolean login(String username, String password) {
        boolean state=false;
        Map<String,String> userMap=intUser();
        if (userMap.containsKey(username)&&password.equals(userMap.get(username))){
            System.out.println("登录成功");
            return  true;
        }else {
            System.out.println("登录失败");
        }
        return false;
    }

    public static Map<String, String> intUser() {
        Map<String,String> userMap=new HashMap<>();
        userMap.put("zhangsan","123456");
        userMap.put("lisi","123456");
        userMap.put("wangwu","123456");
        userMap.put("zhaoliu","123456");
        return  userMap;
    }
}
